from urllib import request,parse
import fake_useragent
url='http://www.baidu.com/s?wd={}'
word=input('Content to search: ')
params=parse.quote(word)
full_url=url.format(params)
headers={'User-Agent':fake_useragent.UserAgent().chrome}
req=request.Request(url=full_url,headers=headers)
response=request.urlopen(req)
html=response.read().decode('utf-8')
filename=word+'.html'
with open(filename,'w',encoding='utf-8') as f:
    f.write(html)
